<?php
/**
 * Created by PhpStorm.
 * User: zhuwansan
 * Date: 16/8/7
 * Time: 下午6:43
 * RESTful 演示实例
 * RESTful 服务类
 */

class Site{
    private $sites = array(
        1 => 'TaoBao',
        2 => 'Google',
        3 => 'Runoob',
        4 => 'Baidu',
        5 => 'Weibo',
        6 => 'Sina'
    );

    public function getAllSite(){
        return $this->sites;
    }
    public function getSite($id){
        $site = array($id => ($this->sites[$id]) ? $this->sites[$id] :$this->sites[1]);
        return $site;
    }
}

//?l_id=2&l_title=title_2&l_desc=desc_2
//?view=labels